package com.cwm.test.proxy.staticproxy;

public class CalculatorProxy implements Source {
    private final Source calculator;
    
    public CalculatorProxy(Source calculator) {
        this.calculator = calculator;
    }

    @Override
    public int add(int a, int b) {
        System.out.println("执行加法操作");
        return calculator.add(a, b);
    }

    @Override
    public int sub(int a, int b) {
        System.out.println("执行减法操作");
        return calculator.sub(a, b);
    }

    @Override
    public int mul(int a, int b) {
        System.out.println("执行乘法操作");
        return calculator.mul(a, b);
    }

    @Override
    public int div(int a, int b) {
        System.out.println("执行除法操作");
        return calculator.div(a, b);
    }
}
